<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import ContactList from './ContactList/index.vue';
import ContactManagement from './ContactManagement/index.vue';

const route = ref('');
const enterAction = ref({});

onMounted(() => {
    window.utools.onPluginEnter((action) => {
        console.log('插件入口事件:', action);
        route.value = action.code;
        enterAction.value = action;
        console.log('当前路由代码:', action.code);
    });
    window.utools.onPluginOut((isKill) => {
        route.value = '';
    });
});
</script>

<template>
    <template v-if="route === 'list'">
        <ContactList :enterAction="enterAction"></ContactList>
    </template>
    <template v-if="route === 'manage'">
        <ContactManagement :enterAction="enterAction"></ContactManagement>
    </template>
</template>
